{extend name="base"}
{block name="title"}奖品详情{/block}
{block name="head"}
<style>
.tab-content dl dt {width:64px;}
.tab-content dl dd {margin-left:70px;}
textarea{max-width:300px; max-height:65px;}
</style>
{/block}
{block name="body"}
<body class="mainbody" style="padding:0;margin:0;">
<form>
<div class="tab-content" style="border:1px solid #eee;padding:0 10px;">
  <dl><dt>所属渠道：</dt><dd>[{$item.Channel}]{$CHANNELS[$item.Channel]['Name'] ?? ''}</dd></dl>
  <dl><dt>奖品标题：</dt><dd><input type="text" class="input normal" autocomplete="off" name="Title" value="{$item.Title??''}" /></dd></dl>
  <dl>
    <dt>中奖概率：</dt>
    <dd>
      <input type="text" class="input small" autocomplete="off" name="Rate" value="{$item.Rate??0}" />%
      <span class="Validform_checktip">*正整数[0-100]</span>
    </dd>
  </dl>
  <dl id="Type">
    <dt>奖品类型：</dt>
    <dd>
      <div class="rule-multi-radio">
        <span style="display: none;">
        {foreach name="AWTYPES" item="val"}
          <input type="radio" name="Type" value="{$key}"{eq name="item.Type" value="$key"} checked{/eq} /><label>{$key}={$val}</label>
        {/foreach}
        </span>
      </div>
      <span class="Validform_checktip">*{$item.Type}</span>
    </dd>
  </dl>
  <dl id="Reward"{in name="item.Type*1" value="0"} style="display:none"{/in}>
    <dt>奖品价值：</dt>
    <dd>
      <input type="text" class="input small" autocomplete="off" name="Reward" value="{$item.Reward??0}" />
      <span class="Validform_checktip">*金币数或房卡数,正整数</span>
    </dd>
  </dl>
  <dl id="KindID"{in name="item.Type*1" value="0,1"} style="display:none"{/in}>
    <dt>对应游戏：</dt>
    <dd>
      <div class="rule-single-select">
        <select name="KindID" style="display:none" data-auto="0">
          <option value="0">[0]无</option>
          {volist name="GAME_KIND" id='val'}
          <option value="{$key}"{eq name="item.KindID" value="$key"} selected{/eq}>[{$key}]{$val}</option>
          {/volist}
        </select>
      </div>
      <span class="Validform_checktip">*当奖励类型为房卡时有效</span>
    </dd>
  </dl>
  <dl>
    <dt>备注描述：</dt>
    <dd>
      <textarea class="input" name="Remark">{$item.Remark??''}</textarea>
      <span class="Validform_checktip">*最长255字</span>
    </dd>
  </dl>
  <dl><dt>创建时间：</dt><dd>{$item.CreateTime??''}</dd></dl>
  <dl><dt>更新时间：</dt><dd>{$item.UpdateTime??''}</dd></dl>
</div>
</form>
<script>
$(function () {

  $("dl#Type input[type='radio']").click(function () {
    var val = $(this).val();
    console.log("click", val);
    
    var dlReward = $('dl#Reward');
    var dlKindID = $('dl#KindID');
    var ipReward = $('input', dlReward);
    var ipKindID = $('select', dlKindID);;
    
    if (val == 0) { // 普通
      dlReward.hide();
      dlKindID.hide();
      ipReward.val(0);
      ipKindID.val(0);  //
      $('.select-items li', dlKindID).removeClass('selected');
      var eax = $('.select-items li:first', dlKindID).text();
      $('.select-tit span', dlKindID).text(eax);
    } else if (val == 1) {  // 金币
      dlReward.show();
      dlKindID.hide();
    } else if (val == 2) {  // 房卡
      dlReward.show();
      dlKindID.show();
    }
  });

});
</script>
</body>
{/block}